package MineGod;

import org.lwjgl.opengl.GL11;
import org.newdawn.slick.opengl.Texture;

public abstract class GUILabel {
	
	public double x;
	public double y;
	public double width;
	public double height;
	protected boolean active;
	protected boolean hidden;
	
	public abstract Texture getTexture();
	
	public void render(double zIndex){
		if (!hidden){
			GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
			GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
			getTexture().bind();
			if (active){
				GL11.glColor3d(1, 1, 1);
			} else{
				GL11.glColor3d(.25, .25, .25);
			}
			GL11.glBegin(GL11.GL_QUADS);
				GL11.glNormal3d(0, 0, 1);
				GL11.glTexCoord2d(0.0, 0.0);
				GL11.glVertex3d(x, y, zIndex);
				GL11.glTexCoord2d(1.0, 0.0);
				GL11.glVertex3d(x + width, y, zIndex);
				GL11.glTexCoord2d(1.0, 1.0);
				GL11.glVertex3d(x + width, y + height, zIndex);
				GL11.glTexCoord2d(0.0, 1.0);
				GL11.glVertex3d(x, y + height, zIndex);
			GL11.glEnd();
		}
	}
}
